<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>documentName</title>
  </head>

  <body>
    <div class="box2938">容器</div>

    <script src="https://cdn.bootcdn.net/ajax/libs/jquery/3.7.1/jquery.min.js"></script>
    <script>
      // 参数部分是变量值

      var id = 2938 // 模拟变量

      console.log('获取', $('.box' + id).html()) // '获取 容器'
    </script>
  </body>
</html>
